<template>
    <fieldset>
        <legend>商品列表</legend>
        <ul>
            <li v-for="(item,i) in l" :key="i" @click="clickFn(item.productId)">
                <!-- <router-link :to="{path:`/detail/${item.productId}`}">
                {{ item.productName }}
                </router-link> -->
            </li>
        </ul>
    </fieldset>
</template>
<script>
    export default{
        data(){
            return{
                l:[]
            }
        },
        mounted(){
            fetch("http://chst.vip:1234/api/getmoneyctrl")
            .then(body =>body.json())
            .then(res =>{
                console.log(res)
                this.l = res.result;
            })
        },
     methods: {
            clickFn(i) {
            this.$router.push({ path: "/particulars", query: { particulars: i } });
            },
        },
    }


</script>